package queue

import "errors"

type Queue []int

func (q *Queue) Push(v int) {
	*q = append(*q, v)
}

func (q *Queue) Pop() (int, error) {
	if q.IsEmpty() {
		return 0, errors.New("quere is empty")
	}

	head := (*q)[0]
	*q = (*q)[1:]
	return head, nil
}

func (q *Queue) IsEmpty() bool {
	return len(*q) == 0
}
